1. Field of the Invention
The present invention relates to the calculation of shadow data in a computer graphic, and more particularly, to a rendering method and apparatus, game system, and computer readable program product that stores a program for calculating data relating to the shadowing of an object in a virtual space.
2. Description of the Related Art
In the past, in game systems, the shadow of an object caused by light emitted from a light source in a three-dimensional space, that is, a virtual space, was rarely drawn. When drawing a shadow, the polygons of the object were projected on a plane able to give a shadow by the light emitted from the light source and the plane including the projected polygons was transformed in perspective so as to draw the shadow of the polygons on the screen. When the object expressed the face of a person etc., the object included a large number of polygons and the shadow of the polygons could be projected on other polygons. If there are n (where n is a natural number) number of polygons, processing for projecting polygons for the square of n times is necessary. Therefore, the amount of calculation ends up becoming greater and the speed of drawing becomes slower. Further, if the light source moves, the projection processing must be performed once again. Further, when using the technique of ray tracing for improving the image quality, the amount of calculation for the lighting increases more. It is therefore not practical to move the position of the light source etc. interactively.
On the other hand, processing when moving the perspective is shown in U.S. Pat. No. 5,786,822. This patent assumes several directions for viewing the surface of an actual object forming the basis of the texture data or the surface of an object prepared by computer graphics etc., provides sets of different texture data for every direction, and selects one of the sets of texture data corresponding to the direction in which the surface of the object is viewed for mapping at the time of displaying the object. Further, the above specification discloses, during the processing for selecting the texture data, to select the texture data for the plurality of assumed directions close to the direction in which the surface of the object is actually viewed when that direction does not match with a direction assumed in advance (assumed direction), interpolates the selected texture data from the difference between the direction in which the object is actually viewed and these assumed directions, and maps the thereby obtained data on the displayed object surface as texture data for the direction in which the object is actually viewed.
With this technique, however, the line of sight or perspective and texture data are linked. The texture data never includes portions of the object to be displayed that are not visible from the direction of the line of sight or the perspective.
An object of the present invention is to provide a rendering method and apparatus, game system, and computer readable program product that stores a program able to generate a similar image as with a normal lighting calculation when changing the position of a light source in a virtual space.
According to a first aspect of the present invention, there is provided a method of rendering an object in a virtual space, comprising converting an absolute position of a light source in the virtual space or a relative position between the object and the light source to a position of a point in a shadow data set space comprised of points corresponding to preset light source positions and obtaining the position of the point in the shadow data set space as positional data of the light source; selecting from a plurality of data sets relating to a shadow corresponding to a preset light source positions and calculated and stored in advance for a specific element of the object data set relating to shadow relating to the obtained positional data of the light source; interpolating from a plurality of data sets relating to shadow based on the obtained positional data of the light source to generate an interpolated shadow data set when there are a plurality of data sets relating to shadow selected; and using the interpolated shadow data set to draw the object in the virtual space.
According to a second aspect of the present invention, there is a method of rendering an object in a virtual space, comprising designating a position of a light source in the virtual space; converting the designation to a position of a point in a shadow data set space comprised of points corresponding to preset light source positions and obtaining the position of the point in the shadow data set space as positional data of the light source; selecting from a plurality of data sets relating to shadow corresponding to preset light source positions and calculated and stored in advance for a specific element of the object a data set relating to shadow relating to the obtained positional data of the light source; interpolating from a plurality of data sets relating to shadow based on the obtained positional data of the light source to generate an interpolated shadow data set when there are a plurality of data sets relating to shadow selected; and using the interpolated shadow data set to draw the object in the virtual space.
The method preferably further comprises, when obtaining the positional data of the light source, selecting from a plurality of data sets relating to a shadow corresponding to preset light source positions and calculated and stored in advance for a vertex of a polygon of the object or a surface of the object a data set relating to shadow relating to the obtained positional data of the light source. Alternatively, the method preferably further comprises, when obtaining the positional data of the light source, selecting from a plurality of data sets relating to shadow corresponding to preset light source positions, calculated and stored in advance for a specific element of the object, and expressed by displacement from a reference luminance a data set relating to shadow relating to the obtained positional data of the light source. Still further, the method preferably further comprises, when obtaining the positional data of the light source, selecting from a plurality of data sets relating to shadow corresponding to preset light source positions, calculated and stored in advance for a specific element of the object, and expressed by the luminance of at least one of the three primary colors a data set relating to shadow relating to the obtained positional data of the light source.
According to a third aspect of the present invention, there is provided a method of rendering an object in a virtual space, comprising converting an absolute direction of light from a light source in the virtual space or a relative direction between the object and the light to a position of a point in a shadow data set space comprised of points corresponding to preset directions of light and obtaining the position of the point in the shadow data set space as directional data of the light; selecting from a plurality of data sets relating to shadow corresponding to preset directions of light and calculated and stored in advance for a specific element of the object a data set relating to shadow relating to the obtained directional data of the light; interpolating from a plurality of data sets relating to shadow based on the obtained directional data of the light to generate an interpolated shadow data set when there are a plurality of data sets relating to shadow selected; and using the interpolated shadow data set to draw the object in the virtual space.
According to a fourth aspect of the present invention, there is provided a method of rendering an object in a virtual space, comprising designating a position of light from a light source in the virtual space; converting the designation to a position of a point in a shadow data set space comprised of points corresponding to preset light source directions and obtaining the position of the point in the shadow data set space as directional data of the light from the light source; selecting from a plurality of data sets relating to shadow corresponding to preset directions of light and calculated and stored in advance for a specific element of the object a data set relating to shadow relating to the obtained directional data of the light; interpolating from a plurality of data sets relating to shadow based on the obtained directional data of the light to generate an interpolated shadow data set when there are a plurality of data sets relating to shadow selected; and using the interpolated shadow data set to draw the object in the virtual space.
Note that when a light vector of the light source in the virtual space is designated, the light vector may be obtained as directional data.
Preferably, the method further comprises, when obtaining the directional data of the light, selecting from a plurality of data sets relating to a shadow corresponding to preset directions of light and calculated and stored in advance for a vertex of a polygon of the object or a surface of the object a data set relating to shadow relating to the obtained directional data of the light. Alternatively, the method preferably further comprises, when obtaining the directional data of the light, selecting from a plurality of data sets relating to a shadow corresponding to preset directions of light, calculated and stored in advance for a specific element of the object, and expressed by displacement from a reference luminance a data set relating to shadow relating to the obtained directional data of the light. Still further, the method further comprises, when obtaining the directional data of the light, selecting from a plurality of data sets relating to a shadow corresponding to preset directions of light, calculated and stored in advance for a specific element of the object, and expressed by the luminance of at least one of the three primary colors a data set relating to shadow relating to the obtained directional data of the light.
When one data set relating to a shadow is selected, the method may further comprise outputting the data set relating to shadow as an interpolated shadow data set.
According to a fifth aspect of the present invention, there is provided a computer readable program product storing a program for calculating data relating to shadow of an object in a virtual space, the program making the computer convert an absolute position of a light source in the virtual space or a relative position between the object and the light source to a position of a point in a shadow data set space comprised of points corresponding to preset light source positions and obtain the position of the point in the shadow data set space as positional data of the light source; select from a plurality of data sets relating to shadow corresponding to preset light source positions and calculated and stored in advance for a specific element of the object a data set relating to shadow relating to the obtained positional data of the light source; interpolate from a plurality of data sets relating to shadow based on the obtained positional data of the light source to generate an interpolated shadow data set when there are a plurality of data sets relating to shadow selected; and instruct use of the interpolated shadow data set to draw the object in the virtual space.
According to a sixth aspect of the present invention, there is provided a computer readable program product that stores a program for calculating data relating to a shadow of an object in a virtual space, the program making the computer designate a position of a light source in the virtual space; convert the designation to a position of a point in a shadow data set space comprised of points corresponding to preset light source positions and obtain the position of the point in the shadow data set space as positional data of the light source; select from a plurality of data sets relating to the shadow corresponding to preset light source positions and calculated and stored in advance for a specific element of the object a data set relating to the shadow relating to the obtained positional data of the light source; interpolate from a plurality of data sets relating to shadow based on the obtained positional data of the light source to generate an interpolated shadow data set when there are a plurality of data sets relating to shadow selected; and instruct use of the interpolated shadow data set to draw the object in the virtual space.
According to a seventh aspect of the present invention, there is provided a computer readable program product for storing a program that calculates data relating to a shadow of an object in a virtual space, the program making the computer convert an absolute direction of light from a light source in the virtual space or a relative direction between the object and the light to a position of a point in a shadow data set space comprised of points corresponding to preset directions of light and obtain the position of the point in the shadow data set space as directional data of the light; select from a plurality of data sets relating to shadow corresponding to preset directions of light and calculated and stored in advance for a specific element of the object a data set relating to shadow relating to the obtained directional data of the light; interpolate from a plurality of data sets relating to shadow based on the obtained directional data of the light to generate an interpolated shadow data set when there are a plurality of data sets relating to shadow selected; and instruct use of the interpolated shadow data set to draw the object in the virtual space.
According to an eighth aspect of the present invention, there is provided a computer readable program product for storing a program for calculating data relating to shadow of an object in a virtual space, the program making the computer designate a position of light from a light source in the virtual space; convert the designation to a position of a point in a shadow data set space comprised of points corresponding to preset light source directions and obtain the position of the point in the shadow data set space as directional data of the light from the light source; select from a plurality of data sets relating to shadow corresponding to preset directions of light and calculated and stored in advance for a specific element of the object a data set relating to shadow relating to the obtained directional data of the light; interpolate from a plurality of data sets relating to shadow based on the obtained directional data of the light to generate an interpolated shadow data set when there are a plurality of data sets relating to shadow selected; and instruct use of the interpolated shadow data set to draw the object in the virtual space.
According to a ninth aspect of the present invention, there is provided an apparatus for rendering an object in a virtual space, comprising a system that converts an absolute position of a light source in the virtual space or a relative position between the object and the light source to a position of a point in a shadow data set space comprised of points corresponding to preset light source positions and obtaining the position of the point in the shadow data set space as positional data of the light source; a selector that selects from a plurality of data sets relating to a shadow corresponding to preset light source positions and calculated and stored in advance for a specific element of the object a data set relating to shadow relating to the obtained positional data of the light source; a generator that interpolates from a plurality of data sets relating to a shadow based on the obtained positional data of the light source to generate an interpolated shadow data set when there are a plurality of data sets relating to shadow selected; and a system that uses the interpolated shadow data set to draw the object in the virtual space.
According to a 10th aspect of the present invention, there is provided an apparatus for rendering an object in a virtual space, comprising a system that designates a position of a light source in the virtual space; a system that converts the designation to a position of a point in a shadow data set space comprised of points corresponding to preset light source positions and obtaining the position of the point in the shadow data set space as positional data of the light source; a selector for selecting from a plurality of data sets relating to shadow corresponding to preset light source positions and calculated and stored in advance for a specific element of the object a data set relating to shadow relating to the obtained positional data of the light source; a generator for interpolating from a plurality of data sets relating to shadow based on the obtained positional data of the light source to generate an interpolated shadow data set when there are a plurality of data sets relating to shadow selected; and a system that uses the interpolated shadow data set to draw the object in the virtual space.
According to an 11th aspect of the present invention, there is provided an apparatus for rendering an object in a virtual space, comprising a system that converts an absolute direction of light from a light source in the virtual space or a relative direction between the object and the light to a position of a point in a shadow data set space comprised of points corresponding to preset directions of light and obtaining the position of the point in the shadow data set space as directional data of the light; a selector for selecting from a plurality of data sets relating to shadow corresponding to preset directions of light and calculated and stored in advance for a specific element of the object a data set relating to shadow relating to the obtained directional data of the light; a generator for interpolating from a plurality of data sets relating to shadow based on the obtained directional data of the light to generate an interpolated shadow data set when there are a plurality of data sets relating to shadow selected; and a system that uses the interpolated shadow data set to draw the object in the virtual space.
According to a 12th aspect of the present invention, there is provided an apparatus for rendering an object in a virtual space, comprising a system that designates a position of light from a light source in the virtual space; a system that converts the designation to a position of a point in a shadow data set space comprised of points corresponding to preset light source directions and obtaining the position of the point in the shadow data set space as directional data of the light from the light source; a selector for selecting from a plurality of data sets relating to shadow corresponding to preset directions of light and calculated and stored in advance for a specific element of the object a data set relating to shadow relating to the obtained directional data of the light; a generator for interpolating from a plurality of data sets relating to shadow based on the obtained directional data of the light to generate an interpolated shadow data set when there are a plurality of data sets relating to shadow selected; and a system that uses the interpolated shadow data set to draw the object in the virtual space.
According to a 13th aspect of the present invention, there is provided a game system for rendering an object in a virtual space, comprising a computer and a computer readable program product that stores a program for making a computer convert an absolute position of a light source in the virtual space or a relative position between the object and the light source to a position of a point in a shadow data set space comprised of points corresponding to preset light source positions, and obtain the position of the point in the shadow data set space as positional data of the light source, selecting from a plurality of data sets relating to shadow corresponding to preset light source positions and calculated and stored in advance for a specific element of the object a data set relating to shadow relating to the obtained positional data of the light source, interpolating from a plurality of data sets relating to shadow based on the obtained positional data of the light source to generate an interpolated shadow data set when there are a plurality of data sets relating to shadow selected, and instructing the use of the interpolated shadow data set to draw the object in the virtual space.
According to a 14th aspect of the present invention, there is provided a game system for rendering an object in a virtual space, comprising a computer and a computer readable program product that stores a program for making the computer designate a position of a light source in the virtual space, converting the designation to a position of a point in a shadow data set space comprised of points corresponding to preset light source positions and obtaining the position of the point in the shadow data set space as positional data of the light source, selecting from a plurality of data sets relating to shadow corresponding to preset light source positions and calculated and stored in advance for a specific element of the object a data set relating to shadow relating to the obtained positional data of the light source, interpolating from a plurality of data sets relating to shadow based on the obtained positional data of the light source to generate an interpolated shadow data set when there are a plurality of data sets relating to shadow selected, and instructing the use of the interpolated shadow data set to draw the object in the virtual space.
According to a 15th aspect of the present invention, there is provided a game system for rendering an object in a virtual space, comprising a computer and a computer readable program product that stores a program for making the computer convert an absolute direction of light from a light source in the virtual space or a relative direction between the object and the light to a position of a point in a shadow data set space comprised of points corresponding to preset directions of light and obtaining the position of the point in the shadow data set space as directional data of the light, selecting from a plurality of data sets relating to shadow corresponding to preset directions of light and calculated and stored in advance for a specific element of the object a data set relating to shadow relating to the obtained directional data of the light, interpolating from a plurality of data sets relating to shadow based on the obtained directional data of the light to generate an interpolated shadow data set when there are a plurality of data sets relating to shadow selected, and instructing the use of the interpolated shadow data set to draw the object in the virtual space.
According to a 16th aspect of the present invention, there is provided a game system for rendering an object in a virtual space, comprising a computer and a computer readable program product that stores a program for making the computer designate a position of light from a light source in the virtual space, processing for converting the designation to a position of a point in a shadow data set space comprised of points corresponding to preset light source directions and obtaining the position of the point in the shadow data set space as directional data of the light from the light source, selecting from a plurality of data sets relating to shadow corresponding to preset directions of light and calculated and stored in advance for a specific element of the object a data set relating to shadow relating to the obtained directional data of the light, interpolating from a plurality of data sets relating to shadow based on the obtained directional data of the light to generate an interpolated shadow data set when there are a plurality of data sets relating to shadow selected, and instructing the use of the interpolated shadow data set to draw the object in the virtual space.
According to a 17th aspect of the present invention, there is provided a method of rendering an object in a virtual space, comprising receiving input from at least one of an operator and a program for changing a position of a light source arranged in the virtual space, a position of the object, or a position of the light source and the position of the object; obtaining from the input received data of an absolute position of the light source or data of a relative position of the light source with respect to the object; selecting from a plurality of data sets relating to shadow corresponding to preset light source positions and calculated and stored in advance for a specific element of the object a data set relating to shadow relating to the obtained data of the absolute position of the light source or data of the relative position of the light source; interpolating from a plurality of data sets relating to shadow based on the obtained data of the absolute position of the light source or data of the relative position of the light source to generate an interpolated shadow data set when there are a plurality of data sets relating to shadow selected; and using the interpolated shadow data set to draw the object in the virtual space.
According to an 18th aspect of the present invention, there is provided a method of rendering an object in a virtual space, comprising receiving input from at least one of an operator and a program for changing a direction of light of a light source arranged in the virtual space, a position of the object, or the direction of light of the light source and the position of the object; obtaining from the input received data of an absolute direction of the light or data of a relative direction of the light with respect to the object; selecting from a plurality of data sets relating to shadow corresponding to preset directions of light and calculated and stored in advance for a specific element of the object a data set relating to shadow relating to the obtained data of the absolute position of the light or data of the relative position of the light; interpolating from a plurality of data sets relating to shadow based on the obtained data of the absolute direction of the light or data of the relative direction of the light to generate an interpolated shadow data set when there are a plurality of data sets relating to shadow selected; and using the interpolated shadow data set to draw the object in the virtual space.
According to a 19th aspect of the present invention, there is provided a computer readable program product that stores a program for calculating data relating to shadow of an object in a virtual space, the program making the computer receive input from at least one of an operator and a program for changing a position of a light source arranged in the virtual space, a position of the object, or a position of the light source and the position of the object; obtain from the input received data of an absolute position of the light source or data of a relative position of the light source with respect to the object; select from a plurality of data sets relating to shadow corresponding to preset light source positions and calculated and stored in advance for a specific element of the object a data set relating to shadow relating to the obtained data of the absolute position of the light source or data of the relative position of the light source; interpolate from a plurality of data sets relating to shadow based on the obtained data of the absolute position of the light source or data of the relative position of the light source to generate an interpolated shadow data set when there are a plurality of data sets relating to shadow selected; and instruct use of the interpolated shadow data set to draw the object in the virtual space.
According to a 20th aspect of the present invention, there is provided a computer readable program product that stores a program for calculating data relating to a shadow of an object in a virtual space, the program making the computer receive input from at least one of an operator and a program for changing a direction of light of a light source arranged in the virtual space, a position of the object, or the direction of light of the light source and the position of the object; obtain from the input received data of an absolute direction of the light or data of a relative direction of the light with respect to the object; select from a plurality of data sets relating to the shadow corresponding to preset directions of light and calculated and stored in advance for a specific element of the object a data set relating to the shadow relating to the obtained data of the absolute position of the light or data of the relative position of the light; interpolate from a plurality of data sets relating to the shadow based on the obtained data of the absolute direction of the light or data of the relative direction of the light to generate an interpolated shadow data set when there are a plurality of data sets relating to shadow selected; and instruct use of the interpolated shadow data set to draw the object in the virtual space.
According to a 21st aspect of the present invention, there is provided an apparatus for rendering an object in a virtual space, comprising a system that receives an input from at least one of an operator and a program for changing a position of a light source arranged in the virtual space, a position of the object, or a position of the light source and the position of the object; a system that obtains, from the input received, data of an absolute position of the light source or data of a relative position of the light source with respect to the object; a selector that selects from a plurality of data sets relating to a shadow corresponding to preset light source positions and calculated and stored in advance for a specific element of the object a data set relating to shadow relating to the obtained data of the absolute position of the light source or data of the relative position of the light source; a generator that interpolates from a plurality of data sets relating to the shadow based on the obtained data of the absolute position of the light source or data of the relative position of the light source to generate an interpolated shadow data set when there are a plurality of data sets relating to the selected shadow; and a system that uses the interpolated shadow data set to draw the object in the virtual space.
According to a 22nd aspect of the present invention, there is provided an apparatus for rendering an object in a virtual space, comprising a system that receives an input from at least one of an operator and a program for changing a direction of light of a light source arranged in the virtual space, a position of the object, or the direction of light of the light source and the position of the object; a system that obtains, from the input received, data of an absolute direction of the light or data of a relative direction of the light with respect to the object; a selector for selecting from a plurality of data sets relating to a shadow corresponding to preset directions of light and calculated and stored in advance for a specific element of the object a data set relating to shadow relating to the obtained data of the absolute position of the light or data of the relative position of the light; a generator for interpolating from a plurality of data sets relating to shadow based on the obtained data of the absolute direction of the light or data of the relative direction of the light to generate an interpolated shadow data set when there are a plurality of data sets relating to the selected shadow; and a system that uses the interpolated shadow data set to draw the object in the virtual space.
According to a 23rd aspect of the present invention, there is provided a game system for rendering an object in a virtual space, comprising a computer and a computer readable program product that stores a program for making the computer receive input from at least one of an operator and a program for changing a position of a light source arranged in the virtual space, a position of the object, or a position of the light source and the position of the object, obtain from the input received data of an absolute position of the light source or data of a relative position of the light source with respect to the object, select from a plurality of data sets relating to shadow corresponding to preset light source positions and calculated and stored in advance for a specific element of the object a data set relating to a shadow relating to the obtained data of the absolute position of the light source or data of the relative position of the light source, interpolate from a plurality of data sets relating to shadow based on the obtained data of the absolute position of the light source or data of the relative position of the light source to generate an interpolated shadow data set when there are a plurality of data sets relating to shadow selected, and using the interpolated shadow data set to draw the object in the virtual space.
According to a 24th aspect of the present invention, there is provided a game system for rendering an object in a virtual space, comprising a computer and a computer readable program that stores a program for making a computer execute processing for receiving input from at least one of an operator and a program for changing a direction of light of a light source arranged in the virtual space, a position of the object, or the direction of light of the light source and the position of the object, obtaining from the input received data of an absolute direction of the light or data of a relative direction of the light with respect to the object, selecting from a plurality of data sets relating to shadow corresponding to preset directions of light and calculated and stored in advance for a specific element of the object a data set relating to shadow relating to the obtained data of the absolute position of the light or data of the relative position of the light, interpolating from a plurality of data sets relating to shadow based on the obtained data of the absolute direction of the light or data of the relative direction of the light to generate an interpolated shadow data set when there are a plurality of data sets relating to the selected shadow, and using the interpolated shadow data set to draw the object in the virtual space.
The present disclosure relates to subject matter contained in Japanese Pat. Application No. HEI 11-195214, filed on Jul. 9, 1999, the disclosure of which is expressly incorporated herein by reference in its entirety.